<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
    <link th:href="@{/js/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet" />
    <link th:href="@{/css/new.css}" rel="stylesheet" />

    <style type="text/css">
        .main{
            color: #333;
            padding: 30px;
        }
        .title{
            font-size: 26px;
            color: #0000FF;
        }
        #orderTable{
            font-size: 14px;
        }
    </style>
</head>

<body  class="gray-bg">

<div col-sm-12 select-table table-striped>
    <p class="title">今日订单</p>
    <table id="bootstrap-table" data-mobile-responsive="true"></table>

</div>


<div th:include="include :: footer"></div>

<script th:inline="javascript">
    var ctx = [[@{
        /}]];
        var id = [[${id}]]
        var prefix = ctx + "system/ncOrderCf";
        var cforderStatus = [[${@dict.getType('cforderStatus')}]];
        var datas = [[${@dict.getType('cforderType')}]];
        $(function() {
            var options = {
                url: prefix + "/todayList/"+id,
                showExport: false,
                showSearch: false,
                showRefresh: false,
                showColumns: false,
                showToggle: false,
                columns: [
                    {
                        title: '序号',
                        formatter: function (value, row, index) {
                            return index + 1;
                        }
                    },
                    {
                        field: 'cropNameCn',
                        title: '作物名称'
                    },
                    {
                        field: 'cropVarietiesCn',
                        title: '作物品种'
                    },
                    {
                        field: 'createTime',
                        title: '录入时间'
                    },
                    {
                        field: 'requestTime',
                        title: '需求日期'
                    },
                    {
                        field: 'cforderType',
                        title: '出库类型',
                        formatter: function (value, row, index) {
                            return $.table.selectDictLabel(datas, value);
                        }
                    },
                    {
                        field: 'requestAmount',
                        title: '需求数量（kg）'
                    },
                    {
                        field: 'cforderStatus',
                        title: '状态',
                        sortable: false,
                        formatter: function (value, row, index) {
                            /*蔬菜类状态：1、待分配，2、待检测，3、待入库，4、待出库，5、已完成
                        牛奶鸡蛋：6、牛舍待确认，7、鸡舍待确认，8、牛舍已确认，9、鸡舍已确认*/
                            return $.table.selectDictLabel(cforderStatus, value);
                        }
                    },
                    {
                        field: 'distribution',
                        title: '分配情况',
                        sortable: false,
                        formatter: function (value, row, index) {
                            if (1 == value) {
                                return "检测"
                            }
                            if (2 == value) {
                                return "仓储"
                            }
                            return "--";
                        }
                    }




                ]
            };
            $.table.init(options);
        });
</script>
</body>

</html>
